<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:oc="http://java.sun.com/jsf/composite/owncomponents"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="template/template.xhtml">
		<ui:define name="content">
			<h:form id="form" styleClass="horizontal_full">
				<p:panel>
						<h1>Supplier Update</h1>
							
					    <h:panelGrid id="supplierConfig" columns="4"  rowClasses="height50">

					    	<h:outputText value="Name"></h:outputText>
					        <p:inputText id="Name" value="#{adminMBean.supplierName}" required="true" />
					        <p></p>
					        <oc:fieldhelp helptext="Name of the Supplier." show="true"/>
					    	
					    	<!-- 
					    	<h:outputText value="Discount per 10 Units"></h:outputText>
					        <p:inputText id="discount" value="#{adminMBean.supplierDiscountPer10Units}" required="true"
					        converterMessage="Discount shoud be between 0 and 1."
							validatorMessage="Discount shoud be between 0 and 1.">
					        	<f:validateDoubleRange minimum="0.0" maximum="1.0"/>
					        </p:inputText>
					        <p></p>
					        <oc:fieldhelp helptext="Describes the discount per 10 units if the are ordered from this supplier." show="true"/>
					    	
					    	<h:outputText value="Delivery Costs"></h:outputText>
					        <p:inputText id="delivery" value="#{adminMBean.supplierDeliveryCosts}" required="true"
					        converterMessage="Delivery Costs should positive."
							validatorMessage="Delivery Costs should positive.">
					        	<f:validateDoubleRange minimum="0.0" />
					        </p:inputText>
					        <p></p>
					        <oc:fieldhelp helptext="Describes the delivery costs from that supplier." show="true"/>
					         -->
					        
					        <h:outputText value="Active"></h:outputText>
					    	<p:selectBooleanCheckbox value="#{adminMBean.supplierActive}" /> 
				            <p></p>
					        <oc:fieldhelp helptext="If the supplier is active it an be used in the Game." show="true"/>  
					        
					    	
					    </h:panelGrid>
					    
					    <p:commandButton action="#{adminMBean.actionUpdateSupplier()}" id="saveButton" value="Save" update=":messages" icon="ui-icon-disk" title="Icon Only" />
						
						<p:commandButton action="#{adminMBean.actionAbortSupplier()}" id="abortButton" value="Abort" update=":messages" icon="ui-icon-circle-close" title="Icon Only" immediate="true"/>
						
					</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>